class Guest < User
  before_create { |u| raise ActiveRecord::ActiveRecordError, 'Guests cannot be saved to the database.' }
  
  def name
    'Guest'
  end
  
  def guest?
    true
  end
  
  def can_create_user?(user = nil)
    true
  end
  
  def can_view_subscription?(subscription = nil)
    false
  end
  
  def base_permissions(action, item_type, item = nil)
    action.to_sym == :view && !(item.respond_to?(:private?) && item.private?)
  end
end
